A technique is known for establishing a wireless connection between a printer and an Access Point (AP) by using a smartphone. In response to accepting an operation by a user, the printer displays a QR code (registered trademark) including information for executing setting of communication parameters and shifts to a reception stand-by state for an authentication request. The smartphone obtains the information for executing setting of the communication parameters by reading the QR code displayed on the printer, sends the authentication request to the printer, and receives an authentication response from the printer. Then, the smartphone uses the obtained information to set the communication parameters, and sends the set communication parameters to the printer. Further, the smartphone executes the similar processes with the AP and sends the communication parameters to the AP. Due to this, the printer can use the received communication parameters to establish the wireless connection with the AP. Further, the printer may be configured to print the QR code, instead of displaying the QR code.